package rsa.lib;

import java.io.DataInputStream;
import java.io.EOFException;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

public class RSAFileInput {
	DataInputStream in;
	int pos;
	public RSAFileInput(String filename) throws FileNotFoundException{
		in = new DataInputStream(new FileInputStream(filename));
		pos = 0;
	}
	
	public int readbyte(byte[] output){
		int size = output.length;
		int i = 0;
		for(i = 0; i < size; i++){
			try {
				int b = in.readUnsignedByte();
				output[i] = (byte) b;
			} catch (IOException e) {
				break;
			}
		}
		return i;
	}
}
